' Place in form and start. (Use at your own expense. Make sure you save all files before starting this form)

Option Explicit 
  
Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long 
  
Public Const EWX_FORCE = 4 
Public Const EWX_LOGOFF = 0 
Public Const EWX_REBOOT = 2 
Public Const EWX_SHUTDOWN = 1 
  
Public Sub Main() 
 Dim Res As Long 
   
 MsgBox ("Your System Will Now Shutdown") 
 
 Res = ExitWindowsEx(EWX_SHUTDOWN, 0) 
   
End Sub 
